package main

import (
	"fmt"
	"github.com/gin-gonic/gin"
)

func main() {
	r := gin.Default()
	r.GET("/:name/:id", func(c *gin.Context) {
		c.JSON(200, gin.H{
			"id":   c.Param("id"),
			"name": c.Param("name"),
		})
	})
	// 泛绑定--user开头全部转发过来
	r.GET("/user/*action", func(c *gin.Context) {
		c.JSON(200, gin.H{
			"message": "get",
		})
	})
	// 端口默认8080
	err := r.Run("127.0.0.1:6789")
	fmt.Println("err", err)
}
